﻿#pragma once

#ifndef QCEFV8HANDLER_H
#define QCEFV8HANDLER_H

#include "QCefHeader.h"

class QCefRenderClient;

class QCefV8Handler : public CefV8Handler
{
public:
    QCefV8Handler(QCefRenderClient* client);
    virtual ~QCefV8Handler();

public:
    virtual bool Execute(const CefString& function,
                         CefRefPtr<CefV8Value> object,
                         const CefV8ValueList& arguments,
                         CefRefPtr<CefV8Value>& retval,
                         CefString& exception) override;

protected:
    bool reportJavaScriptResult(CefRefPtr<CefV8Value> object,
                               const CefV8ValueList& arguments,
                               CefRefPtr<CefV8Value>& retval,
                               CefString& exception);

protected:
    QCefRenderClient * m_client;

private:
    IMPLEMENT_REFCOUNTING(QCefV8Handler);
};

#endif // QCEFV8HANDLER_H
